﻿Imports System.Data.OleDb

Public Class addClaim
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub bt_saveWorker_Click(sender As Object, e As EventArgs) Handles bt_saveWorker.Click
        Dim oleDbConn As New OleDbConnection(ConfigurationManager.ConnectionStrings("ClaimsConnectionString").ConnectionString)
        'Dim SqlString As String = "Insert Into Worker (workerNRC, workerName, workerGender, workerOccupation, workerDOB, workerVillage, workerChief, workerDistrict, workerAddress, workerEmail, workerTelNbr, workerMaritalStatus, workerSpouseName, workerSpouseDOB, workerRLHanded) Values (@f2,@f3,@f4,@f5,@f6,@f7,@f8,@f9,@f10,@f11,@f12,@f13,@f14,@f15,@f16)"
        Dim SqlString As String = "Insert Into Worker (workerNRC, workerName, workerGender, workerOccupation, workerDOB, workerVillage, workerChief, workerDistrict, workerAddress, workerEmail, workerTelNbr, workerMaritalStatus, workerSpouseName, workerSpouseDOB, workerRLHanded) Values (@f2,@f3, @f4, @f5, @f6, @f7, @f8, @f9, @f10, @f11, @f12,@f13,@f14,@f15,@f16)"
        Dim cmd As OleDbCommand = New OleDbCommand(SqlString, oleDbConn)
        cmd.CommandType = CommandType.Text
        'cmd.Parameters.AddWithValue("@f1", tb_workerManNbr.Text)
        cmd.Parameters.AddWithValue("@f2", tb_workerNRC.Text)
        cmd.Parameters.AddWithValue("@f3", tb_workerName.Text)
        cmd.Parameters.AddWithValue("@f4", tb_workerGender.Text)
        cmd.Parameters.AddWithValue("@f5", tb_workerOccupation.Text)
        cmd.Parameters.AddWithValue("@f6", tb_workerDOB.Text)
        cmd.Parameters.AddWithValue("@f7", tb_workerVillage.Text)
        cmd.Parameters.AddWithValue("@f8", tb_workerChief.Text)
        cmd.Parameters.AddWithValue("@f9", tb_workerDistrict.Text)
        cmd.Parameters.AddWithValue("@f10", tb_workerAddress.Text)
        cmd.Parameters.AddWithValue("@f11", tb_workerEmail.Text)
        cmd.Parameters.AddWithValue("@f12", tb_workerTelNbr.Text)
        cmd.Parameters.AddWithValue("@f13", tb_workerMaritalStatus.Text)
        cmd.Parameters.AddWithValue("@f14", tb_workerSpouseName.Text)
        cmd.Parameters.AddWithValue("@f15", tb_workerSpouseDOB.Text)
        cmd.Parameters.AddWithValue("@f16", tb_workerRLHanded.Text)
        oleDbConn.Open()
        cmd.ExecuteNonQuery()
        'Response.Redirect("workerConfirmation.aspx")
        Response.Redirect("addChild.aspx?workerNRC=" & tb_workerNRC.Text)
    End Sub
End Class